package com.fjnldx.mes.domain.domainReq;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.thymeleaf.util.StringUtils;

import java.time.LocalDate;

@Data
public class DevSnSelectedStatusReq {
    private String org;
    private String cj;
    private String gongxu;
    //private String equipment;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate time;
    private String bc;
    private String current_work_type;
    private String gh;
    private String pz;
// ||data.getOrg() == null || StringUtils.isEmpty(data.getOrg())
    public static Boolean checkParams(DevSnSelectedStatusReq data) {
        if (data.getPz() == null || StringUtils.isEmpty(data.getPz())  || data.getCj() == null || StringUtils.isEmpty(data.getCj()) || data.getGongxu() == null || StringUtils.isEmpty(data.getGongxu()) || data.getTime() == null || data.getBc() == null || StringUtils.isEmpty(data.getBc()) || data.getCurrent_work_type() == null || StringUtils.isEmpty(data.getCurrent_work_type()) || data.getGh() == null || StringUtils.isEmpty(data.getGh())) {
            return false;
        }
        return true;
    }

}
